<template>
  <div class="_list" v-loading="loading">
      <a-empty class="position-r" style="top:80px" v-if="list.length == 0" />
      <div
        class="margin-t-20"
        v-else
        v-for="(item, index) in list"
        :key="index">
        <program-card
          :id="item.id"
          :name="item.name"
          :status="item.status"
          :devCount="item.devCount"
          :index="index"
          @refreshList="refreshList"
        ></program-card>
      </div>
  </div>
</template>
<script>
import programCard from "./programCard.vue"
import { list } from "@/services/tenant";

export default {
  name: "companyList",
  components: {programCard},
  data() {
    return {
      list:[],
      loading:false
    };
  },
  computed: {},
  created() {
  },
  methods: {
    getTenant(page,searchForm){
      this.loading = true;
      list(Object.assign(page,searchForm)).then(({data}) => {
        if(data.code == 0){
          this.loading = false;
          this.list = data.data.list;
          this.$emit('getTotal',data.data.totalRow)
        }
      })
    },
    refreshList(data) {
      console.log(data)
      this.list[data.index]["status"] = data.status;
    },
   
  },
};
</script>

<style lang="less" scoped>
._list{
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
  height: 200px;
}
</style>
